import adminRequest from "@/utils/http/adminRequest.js";

// 分页查询
export const categoryListAPI = (params) => {
    return adminRequest.get('game/admin/category/page', {
        params
    })
}

// 新增分类
export const categoryAddAPI = (name) => {
    return adminRequest.post('game/admin/category', name)
}

// 批量删除
export const categoryDeleteAPI = (ids) => {
    return adminRequest.delete('game/admin/category', {
        data: ids
    })
}

// 修改分类
export const categoryEditAPI = (category) => {
    return adminRequest.put('game/admin/category', category)
}

// 查询分类
export const categoryGetAPI = (id) => {
    return adminRequest.get(`game/admin/category/${id}`)
}

// 查询所有分类
export const categoriesGetAllAPI = (name) => {
    return adminRequest.get('game/category', {
        params: {name}
    })
}

// 修改游戏分类
export const gameCategoryEditAPI = (gameCategory) => {
    return adminRequest.put('game/admin/categories', gameCategory)
}

// 添加游戏分类
export const gameCategoryAddAPI = (gameCategory) => {
    return adminRequest.post('game/admin/categories', gameCategory)
}
